package coroutines.coroutinescope.exception

import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class CoroutineScopeTest {
}

fun main() {
    GlobalScope.launch {
        coroutineScope {
            delay(100)

            println("launch() 0")
        }

        coroutineScope {
            delay(200)

            throw Throwable("哔哩哔哩")
        }

        coroutineScope {
            delay(300)

            println("launch() 1")
        }
    }

    try {
        Thread.sleep(400)

        println("main() 400ms")
    } catch (t: Throwable) {
        t.printStackTrace()
    }
}